<template>
    <view class="pt-15">
        <view class="text-s-reminder text-primary text-center pb-15">准备登录...</view>
        <view class="pl-27">
            <!-- 时间轴 -->
            <tui-time-axis>
                <tui-timeaxis-item backgroundColor="transparent">
                    <template v-slot:node>
                        <view
                            class="w-22 h-22 rounded-circle flex items-center justify-center"
                            :class="hasDebug ? 'bg-primary' : 'bg-unSelect'"
                            @click="toggleDebugAction"
                        >
                            <tui-icon
                                name="check"
                                color="rgb(var(--color-primary-fill))"
                                :size="14"
                            ></tui-icon>
                        </view>
                    </template>
                    <template v-slot:content>
                        <view>
                            <view class="text-tip text-s-reminder pb-10">开发者模式</view>
                            <view v-if="hasDebug" class="text-primary text-s-default">已开启</view>
                            <tui-button
                                v-else
                                type="warning"
                                width="300rpx"
                                height="60rpx"
                                shape="circle"
                                @click="openDebuggerAction"
                                >打开开发者</tui-button
                            >
                        </view>
                    </template>
                </tui-timeaxis-item>

                <tui-timeaxis-item backgroundColor="transparent" v-if="hasDebug">
                    <template v-slot:node>
                        <view
                            class="bg-primary w-22 h-22 rounded-circle flex items-center justify-center"
                            @click="toggleDebugAction"
                        >
                            <tui-icon
                                name="check"
                                color="rgb(var(--color-primary-fill))"
                                :size="14"
                            ></tui-icon>
                        </view>
                    </template>
                    <template v-slot:content>
                        <view>
                            <view class="text-tip text-s-reminder pb-10">前往授权页</view>
                            <tui-button
                                type="warning"
                                width="300rpx"
                                height="60rpx"
                                shape="circle"
                                @click="openAuthPageAction"
                                >点击跳转</tui-button
                            >
                        </view>
                    </template>
                </tui-timeaxis-item>
            </tui-time-axis>
        </view>
    </view>
</template>
<script lang="ts">
export default {
    // #ifdef MP-WEIXIN
    options: {
        virtualHost: true,
    },
    // #endif
};
</script>
<script lang="ts" setup>
import type { ILoginCheckProps, ILoginCheckEmits } from "./components.type.sfc";

withDefaults(defineProps<ILoginCheckProps>(), {});
const emits = defineEmits<ILoginCheckEmits>();
const toggleDebugAction = () => {
    emits("didToggleDebug");
};
// 打开开发者
const openDebuggerAction = () => {
    emits("did2OpenDebugger");
};
const openAuthPageAction = () => {
    emits("did2AuthPage");
};
</script>
<style lang="scss" scoped></style>
